<?php
class NotDiagnosed
{
	public static function check($botObj, $tweet, $condition)
	{
		// 診断のIDとホストを解析する
		mb_regex_encoding('UTF-8');
		mb_ereg_search_init($tweet['message'], "shindanmaker.com.\d+");
		$result = mb_ereg_search();
		
		if(!$result)
			return false;
		
		$url = mb_ereg_search_getregs();
		list($host,$id) = explode('/', $url[0]);

		$sql = "
		SELECT id
		FROM diagnosis
		where id = $id
		";
		
		$response_result = $botObj->db->query($sql);
		if(!$response_result || $response_result->num_rows > 0)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
}
?>